package com.nmsl.masterdocker.controller;


import com.nmsl.common.core.controller.BaseController;
import com.nmsl.common.core.page.TableDataInfo;
import com.nmsl.masterdocker.domain.HospitalizationRegistrationZY;
import com.nmsl.masterdocker.service.HospitalizationRegistrationZYService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/masterdocker/patient")
public class HospitalizationRegistrationZYController extends BaseController {
    @Autowired
    private HospitalizationRegistrationZYService hospitalizationRegistrationZYService;

    @GetMapping
    public TableDataInfo getHospitalizationRegistrationZYByDoctorID( int doctorId) {
//        System.out.println(doctorId);
        List<HospitalizationRegistrationZY> list=hospitalizationRegistrationZYService.getHospitalizationRegistBydockerId(doctorId);
        return getDataTable(list);
    }
//    展示在医生所治疗的病人需要分页
    @GetMapping("/list")
    public TableDataInfo getHospitalizationRegistrationZYByDoctorIDtotal(HospitalizationRegistrationZY hospitalizationRegistrationZY) {
        System.out.println(hospitalizationRegistrationZY);
        startPage();
        List<HospitalizationRegistrationZY> list=hospitalizationRegistrationZYService.getHospitalizationByHospitalizationRegistrationZY(hospitalizationRegistrationZY);

        return getDataTable(list);
    }

}
